<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>欢迎登陆轻松办公系统</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <script type="text/javascript" src="${pageContext.request.contextPath }/js/libs/jquery/1.6/jquery.min.js"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath }/js/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
        <link rel="stylesheet" href="${pageContext.request.contextPath }/css/min.css" />
        <script type="text/javascript" src="${pageContext.request.contextPath }/js/min.js"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath }/content/settings/main.js"></script>
	  	<link rel="stylesheet" href="${pageContext.request.contextPath }/content/settings/style.css" />
	  	<script type="text/javascript">
			$(function(){
				// 指定事件处理函数
				$("[name=powerIds]").click(function(){
					// 当选中或取消一个权限时，也同时选中或取消所有的下级权限
					$(this).siblings("ul").find("input").attr("checked", this.checked);
					//$(this).attr();
					// 当选中一个权限时，也要选中所有的直接上级权限
					if(this.checked == true){
						$(this).parents("li").children("input").attr("checked", true);
					}
				});
			});
		</script>
		<style type="text/css">
			a{text-decoration: none;}
			li{list-style-type: none;}
		</style>
    </head>
    <body>
  <div class="settings" id="settings">
        <div class="wrapper">
            <div class="grid3">
                <div class="titre">背景色</div>
                <a href="url(${pageContext.request.contextPath }/css/img/bg.html" class="backgroundChanger active" title="White"></a>
                <a href="url(${pageContext.request.contextPath }/css/img/dark-bg.html" class="backgroundChanger dark" title="Dark"></a>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>
        <a class="settingbutton" href="#"></a>
    </div>        
        <!--              
                HEAD
         --> 
         <!--==================================登录头部分显示的部分（信息）============================================-->
        <div id="head">
            <div class="left">
                <a href="#" class="button profile"><img src="${pageContext.request.contextPath }/img/icons/top/huser.png" alt="" /></a>
                	你好：
                <a href="#">${sessionScope.user1.user_loginName }</a>
                &nbsp;||&nbsp;
                <a href="${pageContext.request.contextPath }/userAction_logout" onclick="return confirm('确定注销系统吗？')">注销</a>
            </div>
            <div class="right">
                <form action="#" id="search" class="search placeholder">
                    <label>你要找的东西 ?</label>
                    <input type="text" value="" name="q" class="text"/>
                    <input type="submit" value="rechercher" class="submit"/>
                </form>
            </div>
        </div>
        <!--            
                SIDEBAR
         --> 
        <!--=============================== 左侧要显示的数据（菜单）====================================  -->
        <div id="sidebar">
        	<ul>
        		<li>
        			<a href="${pageContext.request.contextPath }/index.jsp"><img src="${pageContext.request.contextPath }/img/icons/menu/home.png" alt="" />返回首页</a>
        		</li>
      			<s:iterator value="#application.topPowerList">
      			<s:if test="#session.user1.hasPowerByName(power_name)">
	       			<li>
	       				<a href="#"><img src="${pageContext.request.contextPath }/img/icons/menu/${power_name }.png" alt="" />${power_name }</a>
	                    <ul>
	                    	<s:iterator value="power_children">
	                    	<s:if test="#session.user1.hasPowerByName(power_name)">
	                        		<li>
	                        			<a href="${pageContext.request.contextPath }${power_url }">${power_name }</a>
	                        		</li>
	                        </s:if>
	              			</s:iterator>
	                    </ul>
	                 </li>
	            </s:if>
	            </s:iterator>
        	</ul>
        </div>       
        <!--            
              CONTENT 
         --> 
        <!-- ===================================中间显示的部分（主体）========================================= -->
	 
	<div id="content" class="white">
			   <div class="bloc">
			   <div class="title"></div>
			    <div class="content dashboard">
			        <div class="center" style="text-align: center;">
			            <a href="linkAction_list" class="shortcut">
			                <img src="img/contact.png" alt="" width="48" height="48"/>
			                通讯录
			            </a>
			            <a href="usermarkAction_list?unique_id=${sessionScope.user1.unique_id }" class="shortcut last">
			                <img src="img/page.png" alt="" width="48" height="48" />
			                我的便签
			            </a>
			            <a href="forum_queryAllForum.action?type=0" class="shortcut">
			                <img src="img/baohu.ico" alt="" width="48" height="48" />
			                论坛板块
			            </a>
			            <a href="applicationAction_list" class="shortcut">
			                <img src="img/rutun.ico" alt="" width="48" height="48" />
			                起草申请
			            </a>
			            <a href="applicationAction_myApplicationList" class="shortcut last">
			                <img src="img/liuchen.ico" alt="" width="48" height="48" />
			                申请列表
			            </a>
			            <a href="applicationAction_myTaskList" class="shortcut last">
			                <img src="img/icon.png" alt="" width="48" height="48" />
			                待我审批
			            </a>
			            <a href="#" class="shortcut last">
			                <img src="img/dep.ico" alt="" width="48" height="48" />
			                我的邮件
			            </a>
			            <a href="#" class="shortcut last">
			                <img src="img/user.ico" alt="" width="48" height="48" />
			                我的任务
			            </a>
			            <div class="cb"></div>
			        </div>
			        <p></p>
			    </div>
			</div>  
	<div class="bloc">
    <div class="title">
       	查看主题：【 ${requestScope.topicNext.postingTitle } 】
    </div>
    <div class="content">

<!--内容显示-->	
	
		<div>
			<a href="${pageContext.request.contextPath }/forum_queryAllForum.action?type=0">论坛</a>
			<font class="MenuPoint"> &gt; </font>
			<a href="${pageContext.request.contextPath }/forum_showTopic.action?forumId=${requestScope.topicNext.forum.forumId }">${requestScope.topicNext.forum.forumName }</a>
			<font class="MenuPoint"> &gt;&gt; </font>
			 ${requestScope.topicNext.postingTitle }
			<div align="right">
				<a href="${pageContext.request.contextPath }/jsp/forumAction/saveTopic.jsp">
					<%-- <img align="absmiddle" src="${pageContext.request.contextPath }/css/style/blue/images/button/publishNewTopic.png"/> --%>
					发新贴&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				</a>
				<span></span>
				<s:iterator value="#application.topPowerList">
				<s:if test="#session.user1.hasPowerByName(power_name)">
					<s:iterator value="power_children">
						<s:if test="#session.user1.hasPowerByName(power_name)">
							<s:iterator value="power_children">
								<s:if test="#session.user1.hasPowerByName(power_name)">
									<s:if test="power_name=='移动到其他板块'">
										<a href="${pageContext.request.contextPath }/forum_queryForums.action?postingTitle=${requestScope.topicNext.postingTitle }">移动到其他版块</a>
									</s:if>
								</s:if>
							</s:iterator>		
						</s:if>
					</s:iterator>
					</s:if>
					</s:iterator>
				<br>
			</div>
		</div>
			<!-- ~~~~~~~~~~~~~~~ 显示主帖 ~~~~~~~~~~~~~~~ -->
			<br>
				<table border="0" cellpadding="0" cellspacing="1" width="100%">
					<tr>
						<td rowspan="3" width="120" class="PhotoArea" align="center" valign="top">
							<!--作者头像-->
							<div class="AuthorPhoto" style="height: 125px;">
								<img border="0" width="120" height="120" src="${pageContext.request.contextPath }/css/style/images/defaultAvatar.gif" 
									onerror="this.onerror=null; this.src='${pageContext.request.contextPath }/css/style/images/defaultAvatar.gif';" />
							</div>
							<!--作者名称-->
								<div class="AuthorName"><font style="font-weight: bold;">主题作者：</font>${requestScope.topicNext.postingAuthor.user_loginName }</div>
						</td>
					</tr>
					<tr><!-- 文章内容 -->
						<td valign="top" align="center">
							<div class="Content">${requestScope.topicNext.postingContent }</div>
						</td>
					</tr>
					<tr><!--显示楼层等信息-->
						<td class="Footer" height="28" align="center" valign="bottom">
							<ul style="margin: 0px; width: 98%;">
								<li style="float: left; line-height:18px;"><font color=#C30000>[楼主]</font>
									${requestScope.topicNext.postingTime }
								</li>
								<li style="float: right;">
								
								<s:iterator value="#application.topPowerList">
										<s:if test="#session.user1.hasPowerByName(power_name)">
											<s:iterator value="power_children">
												<s:if test="#session.user1.hasPowerByName(power_name)">
													<s:iterator value="power_children">
														<s:if test="#session.user1.hasPowerByName(power_name)">
															<s:if test="power_name=='删除'">
																<a class="detail" href="${pageContext.request.contextPath }/topic_deleteTopic.action?postingId=${requestScope.topicNext.postingId }&forumId=${requestScope.topicNext.forum.forumId}" onClick="return confirm('确定要删除本帖吗？')">
																	<img border="0" src="${pageContext.request.contextPath }/css/style/images/delete.gif" />删除
																</a>
															</s:if>
														</s:if>
													</s:iterator>		
												</s:if>
											</s:iterator>
										</s:if>
									</s:iterator>
								
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<a href="javascript:scroll(0,0)">
										<%-- <img border="0" title="返回顶部" src="${pageContext.request.contextPath }/css/style/images/top.gif" /> --%>
										返回顶部
									</a>
								</li>
							</ul>
						</td>
					</tr>
				</table>
			<br><br><br>
			<!-- ~~~~~~~~~~~~~~~ 显示主帖结束 ~~~~~~~~~~~~~~~ -->
			<!-- ~~~~~~~~~~~~~~~ 显示回复列表 ~~~~~~~~~~~~~~~ -->
				<table border="0" cellpadding="0" cellspacing="1" width="100%">
					<c:set value="0" var="floor"></c:set>
					<c:forEach items="${requestScope.replyList }" var="reply" >
					<c:set value="${floor+1}" var="floor"></c:set>
					<tr>
						<td rowspan="3" width="120" class="PhotoArea" align="center" valign="top">
							<!--作者头像-->
							<div class="AuthorPhoto" style="height: 125px;">
								<img border="0" width="120" height="120" src="${pageContext.request.contextPath }/css/style/images/defaultAvatar.gif" 
									onerror="this.onerror=null; this.src='${pageContext.request.contextPath }/css/style/images/defaultAvatar.gif';" />
							</div>
							<!--作者名称-->
							<div class="AuthorName"><font style="font-weight: bold;">回复作者：</font> ${reply.postingAuthor.user_loginName }</div>
						</td>
					</tr>
					<tr><!-- 文章内容 -->
						<td valign="top" align="center">
							<div class="Content">${reply.postingContent}</div>
						</td>
					</tr>
					<tr><!--显示楼层等信息-->
						<td class="Footer" height="28" align="center" valign="bottom">
							<ul style="margin: 0px; width: 98%;">
								<li style="float: left; line-height:18px;"><font color=#C30000>[${floor}楼]</font>
									${reply.postingTime }
								</li>
								<li style="float: right;">
									
									<s:iterator value="#application.topPowerList">
										<s:if test="#session.user1.hasPowerByName(power_name)">
											<s:iterator value="power_children">
												<s:if test="#session.user1.hasPowerByName(power_name)">
													<s:iterator value="power_children">
														<s:if test="#session.user1.hasPowerByName(power_name)">
															<s:if test="power_name=='删除'">
																<a class="detail" href="${pageContext.request.contextPath }/reply_deleteReply.action?postingId=${reply.postingId }&topicId=${reply.topic.postingId}" onClick="return confirm('确定要删除本帖吗？')">
																	<img border="0" src="${pageContext.request.contextPath }/css/style/images/delete.gif" />删除
																</a>
															</s:if>
														</s:if>
													</s:iterator>		
												</s:if>
											</s:iterator>
										</s:if>
									</s:iterator>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<a href="javascript:scroll(0,0)">
										<%-- <img border="0" title="返回顶部" src="${pageContext.request.contextPath }/css/style/images/top.gif" /> --%>
										返回顶部
									</a>
								</li>
							</ul>
						</td>
					</tr>
					<tr><td></td></tr>
					</c:forEach>
				</table>
			
			<!-- ~~~~~~~~~~~~~~~ 显示回复列表结束 ~~~~~~~~~~~~~~~ -->
		<!--分页信息-->
		

<!--显示表单内容-->
	<br>
	<div class="bloc">
    <div class="content">
	<form action="${pageContext.request.contextPath }/reply_addReply.action" style="margin: 0; padding: 0;">
		<div id="PageHead"></div>
			<div class="ItemBlock_Title1">
				<div style="float:left;width: 85%;">
					<a href="${pageContext.request.contextPath }/forum_queryAllForum.action?type=0">论坛</a>
					<font class="MenuPoint"> &gt; </font>
					<a href="${pageContext.request.contextPath }/forum_showTopic.action?forumId=${sessionScope.forumNext.forumId }">${sessionScope.forumNext.forumName }</a>
					<font class="MenuPoint"> &gt; &gt;</font>
					  <font>快速回复：</font>
				</div>
			</div>
	<br>
      <div class="input">
      		<br>
            <label for="input1">主题:</label>
            <input type="text" readonly="readonly" id="input1" name="postingTitle" value="${requestScope.topicNext.postingTitle }"/>
        </div>
        <div class="input textarea">
            <label for="textarea2">回复内容:</label>
            <textarea name="postingContent" id="textarea2" rows="7" class="wysiwyg" cols="4">
            </textarea>
        </div>
         <div class="submit" align="center">
            <input type="submit" value="提交" />
            <input type="button" onclick="javascript:history.go(-1)" value="取消" class="black"/>
        </div>
	</form>
	</div>
	</div>
</div>
</div>
</div>
</body>
</html>